//
//  HACDemoSectionOne.m
//  HACDispatcher
//
//  Created by J.Cheng on 2019/5/14.
//  Copyright © 2019 Happy. All rights reserved.
//

#import "HACDemoSectionOne.h"
#import "HACDemoOneCell.h"

@interface HACDemoSectionOne ()
@property (nonatomic, strong) UIView *header;
@end

@implementation HACDemoSectionOne

- (void)registTableReusableView {
    Class cls = [HACDemoOneCell class];
    [self.tableView registerClass:cls forCellReuseIdentifier:@"abc"];
    [self.tableView registerClass:cls forCellReuseIdentifier:NSStringFromClass(cls)];
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 44;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    return self.header;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"%s--/n%@", __func__, self.viewController);
}

- (UIView *)header {
    if (!_header) {
        _header = [UIView new];
        _header.backgroundColor = [UIColor redColor];
    }
    return _header;
}

- (void)dealloc {
    NSLog(@"%s", __func__);
}

@end
